import os
import xml.etree.ElementTree as ET


const_svn_revision = os.environ["SVN_REVISION"]

tree = ET.parse("trunk/App.config")
root = tree.getroot()
for child in root.findall("./appSettings/add"):
	if (child.get('key') == "svn-revision"):
		child.set('value', const_svn_revision)
		print(const_svn_revision)
		
ET.dump(tree)
tree.write("trunk/App.config")
#add_element = tree.getroot().find("./configuration/appSettings/[@attrib='svn-revision']")
#add_element.set("value", const_svn_revision)

#print("SVN REVISION NUMBER: " + const_svn_revision)